package com.sunqianhu.design_patterns_23.behavioral.memento;

public class Client {
    public static void main(String[] args) {
        TextEditor editor = new TextEditor("Initial content");
        System.out.println("当前内容: " + editor.getContent());
        Memento memento = editor.createMemento();
        editor.setContent("update content");
        System.out.println("修改后的内容: " + editor.getContent());
        editor.restoreFromMemento(memento);
        System.out.println("恢复后的内容: " + editor.getContent());
    }
}
